package com.example.javagd.ws;

import com.google.gson.Gson;

import org.springframework.stereotype.Component;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import javax.websocket.OnClose;
import javax.websocket.OnMessage;
import javax.websocket.OnOpen;
import javax.websocket.Session;
import javax.websocket.server.ServerEndpoint;

/**
 * @program: springdemo
 * @description:
 * @author: hzy
 * @create: 2020-06-15 10:07
 **/
@ServerEndpoint("/ws")
@Component
public class WebSocketServer {
    static Map<String, Session> clients = new ConcurrentHashMap<>();
    Gson gson = new Gson();
    @OnOpen
    public void OnOpen(Session session){
        String s = "";
    }

    @OnClose
    public void OnClose(){
        String s = "";
    }


    @OnMessage
    public void OnMessage(String msg, Session session){

    }

}
